package com.demo2do.fms.admin.dao.supplier;

import java.util.List;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;
import com.demo2do.fms.entity.supplier.SupplierSource;

/**
 * 
 * @author Wy
 *
 */
@Dao("hibernate")
public interface SupplierSourceDao {
    
    /**
     * 
     * @param code
     * @return
     */
    @Query("FROM TransSupplierSource WHERE (code = :code OR name = :code)")
    public List<SupplierSource> listTransSupplier(@Variable("code") String code);
    
    /**
     * 
     * @param code
     * @return
     */
    @Query("FROM WareSupplierSource WHERE (code = :code OR name = :code)")
    public List<SupplierSource> listWareSupplier(@Variable("code") String code);
    
    /**
     * @param code
     * @return
     */
    @Query("FROM TransSupplierSource WHERE code = :code")
    public SupplierSource loadTransSupplier(@Variable("code") String code); 
    
    /**
     * @param code
     * @return
     */
    @Query("FROM WareSupplierSource WHERE code = :code")
    public SupplierSource loadWareSupplier(@Variable("code") String code);

    /**
     * 一般仓储供方
     * @param code
     * @return
     */
    @Query("FROM CommonWareSupplierSource WHERE (code = :code OR name = :code)")
    List<SupplierSource> listCommonWareSupplierSource(@Variable("code") String code);
}
